package com.bizdk.generator.utils.toolkit;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.bizdk.generator.utils.IdWorker53;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 自定义ID生成器
 */
@Slf4j
@Component
public class CustomIdGenerator implements IdentifierGenerator {
    
    @Override
    public Long nextId(Object entity) {
        return IdWorker53.nextId();
    }
    
    @Override
    public String nextUUID(Object entity) {
        return IdWorker53.nextId() + "";
    }
}